/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author dukynguyen
 */
@Entity
@Table(name = "FeedBack", catalog = "eProjectNational_Level_Paper", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "FeedBack.findAll", query = "SELECT f FROM FeedBack f"),
    @NamedQuery(name = "FeedBack.findByFbID", query = "SELECT f FROM FeedBack f WHERE f.fbID = :fbID"),
    @NamedQuery(name = "FeedBack.findByTitle", query = "SELECT f FROM FeedBack f WHERE f.title = :title"),
    @NamedQuery(name = "FeedBack.findByDateSend", query = "SELECT f FROM FeedBack f WHERE f.dateSend = :dateSend"),
    @NamedQuery(name = "FeedBack.findByDateReply", query = "SELECT f FROM FeedBack f WHERE f.dateReply = :dateReply"),
    @NamedQuery(name = "FeedBack.findByIDelete", query = "SELECT f FROM FeedBack f WHERE f.iDelete = :iDelete")})
public class FeedBack implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Basic(optional = false)
    @Column(name = "FbID", nullable = false)
    private Integer fbID;
    @Column(name = "Title", length = 100)
    private String title;
    @Lob
    @Column(name = "FbContent", length = 1073741823)
    private String fbContent;
    @Lob
    @Column(name = "ReplyContent", length = 1073741823)
    private String replyContent;
    @Column(name = "DateSend")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateSend;
    @Column(name = "DateReply")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateReply;
    @Column(name = "iDelete")
    private Boolean iDelete;
    @JoinColumn(name = "Username", referencedColumnName = "Username")
    @ManyToOne
    private Account account;

    public FeedBack() {
    }

    public FeedBack(Integer fbID) {
        this.fbID = fbID;
    }

    public Integer getFbID() {
        return fbID;
    }

    public void setFbID(Integer fbID) {
        this.fbID = fbID;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getFbContent() {
        return fbContent;
    }

    public void setFbContent(String fbContent) {
        this.fbContent = fbContent;
    }

    public String getReplyContent() {
        return replyContent;
    }

    public void setReplyContent(String replyContent) {
        this.replyContent = replyContent;
    }

    public Date getDateSend() {
        return dateSend;
    }

    public void setDateSend(Date dateSend) {
        this.dateSend = dateSend;
    }

    public Date getDateReply() {
        return dateReply;
    }

    public void setDateReply(Date dateReply) {
        this.dateReply = dateReply;
    }

    public Boolean getIDelete() {
        return iDelete;
    }

    public void setIDelete(Boolean iDelete) {
        this.iDelete = iDelete;
    }

    public Account getAccount() {
        return account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fbID != null ? fbID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FeedBack)) {
            return false;
        }
        FeedBack other = (FeedBack) object;
        if ((this.fbID == null && other.fbID != null) || (this.fbID != null && !this.fbID.equals(other.fbID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.FeedBack[fbID=" + fbID + "]";
    }

}
